package com.mao.constructor;

public class Test {
    public static void main(String[] args) {
        //构造器的特点：创建对象时，调用构造器
        Student s1 = new Student();
        Student s2 = new Student("张三");
        System.out.println("==============");

        Student t1 = new Student();
        t1.name = "李四";
        t1.age = 18;
        t1.sex = '男';
        System.out.println(t1.name);
        System.out.println(t1.age);
        System.out.println(t1.sex);
        System.out.println("==============");

        Student t2 = new Student("王五", '女', 20);
        System.out.println(t2.name);
        System.out.println(t2.age);
        System.out.println(t2.sex);

    }
}
